<template>
	<div>
		<cartListItem v-for="(item,index) in cartList" 
									:key='index' 
									:item='item'></cartListItem>
	</div>
</template>

<script>
// import{mapGetters} from 'vuex'
import cartListItem from './cartListItem.vue'
	
	export default {
		name:'cartList',
		computed:{
			// ...mapGetters(['cartList'])
			//有莫名其妙的报错，不如直接在data里面定义cartList
		},
		components:{
			cartListItem
		},
		data(){
			return {
				cartList:this.$store.state.cartList
			}
		}
	}
</script>

<style scoped>
	
</style>
